package com.yu.demo.commons.ex;


import com.yu.demo.commons.enums.ResultInterface;

/**
 * @Description: 自定义业务异常
 * @Author: WengYu
 */
public class UserException extends RuntimeException {

    private Integer code;
    private String message;

    public UserException(ResultInterface ResultInterface) {
        super(ResultInterface.getMessage());
        this.code = ResultInterface.getCode();
        this.message = ResultInterface.getMessage();
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    @Override
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}